import QtQuick 2.5
import QtQuick.Controls 2.1
import ".."

CheckBox
{
    id: control
    font.family: Common.fontMain
    font.pixelSize: 16
    indicator: Rectangle
    {
        width: control.height
        height: width
        radius: 2
        border.color: control.checked ? Common.colorMain : Common.colorText
        border.width: 2

        Rectangle
        {
            width: parent.width / 2
            height: width
            radius: 2
            anchors.centerIn: parent
            color: Common.colorMain
            visible: control.checked
        }
    }

    contentItem: Label
    {
        text: control.text
        font: control.font
        color: Common.colorText
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        leftPadding: control.indicator.width + control.spacing
    }
}
